package com.happy.study.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.happy.study.entity.RecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RecordMapper extends BaseMapper<RecordEntity> {

    @Select (value = "select ri.id,ri.userId,ri.paperId,pi.paperName AS paperName, ri.createTime,ri.changeTime,ri.isUsed from record_info ri left join paper_info pi on ri.paperId = pi.paperId where ri.userId=#{userId}")
    List<RecordEntity> queryList ( int userId );

}
